package com.akw.contrroler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @GetMapping("/hello")
    public String hello() {
        List<String> runoobkey = stringRedisTemplate.opsForList().range("runoobkey", 0, -1);
        stringRedisTemplate.opsForList().leftPush("runoobkey", "Hello, Spring Boot 3");
        System.out.println(runoobkey);
        return "Hello, Spring Boot 3";
    }
}
